<?php

class newsForms extends form {

	public static function add($errors)
	{
		$show = self::dispErrors($errors);
		$show .= '
			<form action="" method="post">
				<fieldset>
					<legend>Add News</legend>
					<ul>
						<li><label for="title">Title: </label><input type="text" id="title" name="title" value="' . self::postValue('title') .'" /></li>
						<li><label for="url">URL: </label><input type="text" id="url" name="url" value="' . self::postValue('url') .'" /></li>
						<li><lavel for="content">Content:</label> ' . form::textarea('content', self::postValue('content')) . '</li>
						<li><input type="submit" name="submit" value="Add News" /></li>
					</ul>
				</fieldset>
			</form>';
			
		return $show;
	}
	
	public static function edit($errors, $news)
	{
		$show = self::dispErrors($errors);
		$show .= '
			<form action="" method="post">
				<fieldset>
					<legend>Add News</legend>
					<ul>
						<li><label for="title">Title: </label><input type="text" id="title" name="title" value="' . stripslashes($news->title) .'" /></li>
						<li><label for="url">URL: </label><input type="text" id="url" name="url" value="' . $news->url .'" /></li>
						<li><lavel for="content">Content:</label> ' . form::textarea('content', stripslashes($news->content)) . '</li>
						<li><input type="submit" name="submit" value="Add News" /></li>
					</ul>
				</fieldset>
			</form>';
			
		return $show;
	}
}

?>